<?php
$dis_id=2;
include("../../inc/conn.inc");
include("../islogin.php");
if($_POST[act]){
$web_list=explode("@",$_POST['web_list']);
mysql_query("update costom_list set c_name='$_POST[c_name]',web_list_id='$web_list[0]',web_list='$web_list[1]',c_info='$_POST[c_info]',picture='$_POST[picture]',c_cl='0',c_sh='0' where id='".$_POST['iid']."'");

echo "<script>alert('修改成功');location='costom_list.php';</script>";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 企业网站配置 &gt;&gt; 编辑网站列表</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">编辑网站列表</TD>
   </TR>
</TABLE>
<br>
<?php
$rs=mysql_query("select * from costom_list where id='".$_GET['xg_id']."'");
$row=mysql_fetch_array($rs);
?>
      <TABLE width="100%" border="0" cellpadding="0" cellSpacing="1" bgcolor="#C1DCF5">
        <TBODY>
        <form method="post" action="" name="form1" onSubmit="return checkform()">
          <TR>
            <td width="19%" height="25" align="right" bgcolor="#EFF6FF">名称<span style="padding-left:4px;"><font color="red">*</font></span></td>
            <TD width="81%" bgcolor="#F9F9F9" style="padding-left:4px;"><input id="c_name" name="c_name" value="<?=$row[c_name]?>" type="text" size="30" maxlength="50">
            限制100个汉字</TD>
          </TR>
		  <TR>
            <td width="19%" height="25" align="right" bgcolor="#EFF6FF">列表分类<span style="padding-left:4px;"><font color="red">*</font></span></td>
            <TD width="81%" bgcolor="#F9F9F9" style="padding-left:4px;"><select name="web_list">
			  <option value="">--选择分类--</option>
			  <?php 
			  $w_rs=@mysql_query("select * from web_list where member_id='".$_COOKIE['user_id']."' order by id asc");
			  while($w_row=@mysql_fetch_array($w_rs)){
			  ?>
			   <option value="<?=$w_row[id]?>@<?=$w_row[w_name]?>" <?php if($row[web_list_id]==$w_row[id]){echo "selected";}?> ><?=$w_row[w_name]?></option>
			   <?php }?>
			</select>&nbsp;&nbsp;<a href="costom_type.php" style="color:#CC0000;text-decoration:underline;">添加新分类</a></TD>
          </TR>
          <TR>
            <td height="25" align="right" bgcolor="#EFF6FF">详细内容<font color="red">*</font><span style="padding-left:4px;"> </span> </td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><textarea name="c_info" cols="65" rows="18" id="c_info"><?=$row[c_info]?></textarea></TD>
          </TR>
          <TR>
            <td height="25" align="right" bgcolor="#EFF6FF">图片</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><?php if($row[picture]){?><img src="/upfile/<?=$row[picture]?>" <?=imgstr("../../upfile/$row[picture]","113","160")?> border="0" /><br /><?php }?><input name="picture" type="text" size="35" value="<?=$row[picture]?>">&nbsp;&nbsp;<input name="button" type="button" onClick="window.open ('../upfile.php', 'newwindow', 'height=50, width=400, top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')" value="上传图片">
(<font color="#FF0000">图片限制为:113*160</font>)</TD>
          </TR>
          <TR>
            <td height="25" align="center" bgcolor="#EFF6FF">&nbsp;</td>
            <TD bgcolor="#F9F9F9" style="padding-left:4px;"><input type="hidden" name="iid" value="<?=$row['id']?>"><input type="submit" value="提交">
            <input type="hidden" name="act" value="ok"></TD>
          </TR>
 </form>                
</TABLE>
</div>
<div class="onl"></div>
<?php include("../inc/foot.php");?>
</div>
</body>
</html>

<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){
if($("c_name").value==""){
alert("名称不能为空");
$("c_name").focus();
return false;
}
if($("web_list").value==""){
alert("选择分类");
$("web_list").focus();
return false;
}
if($("c_info").value==""){
alert("详细内容不能为空");
$("c_info").focus();
return false;
}
}
</script>